<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../../head.jsp"%>
	<noscript>
		<div class="alert alert-block span10">
			<h4 class="alert-heading">Warning!</h4>
			<p>You need to have <a href="http://en.wikipedia.org/wiki/JavaScript" target="_blank">JavaScript</a> enabled to use this site.</p>
		</div>
	</noscript>
	<div id="content" class="span10"><!-- content starts -->
		<div class="alert alert-success">
			<strong><a href="${base }user_frontIndex">首页</a>&gt;&gt;我的订单</strong>
		</div>
		<div class="row-fluid sortable">		
			<div class="box span12">
				<div class="box-header well" data-original-title>
					<h2><i class="icon-user"></i>我的订单</h2>
					<div class="box-icon">
						<a href="#" class="btn btn-setting btn-round"><i class="icon-cog"></i></a>
						<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
						<a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>
					</div>
				</div>
				<div class="box-content">
					<table class="table table-striped table-bordered bootstrap-datatable datatable">
						<tr>
						  	<th>商家名称</th>
						  	<th>订单金额（元）</th>
						  	<th>订单数量</th>
						  	<th>操作</th>
						</tr>
					  	<tbody id="orderList"></tbody>
					</table>
				</div><!-- box-content end -->
			</div><!-- box span12 end  -->
		</div><!-- row-fluid sortable end  -->
	</div>
	<script type="text/javascript">
	<!--
		$(function (){
			getOrderList = function() {
				$("#orderList").html("");
				$.ajax({
					url : "${base}shop_getMyOrderList/${user.id}",
					success : function(response) {
						var info = "" ;
						$.each(response.orderlist, function(i, item) {
						  	info += "<tr>";
						  	info += "<td>"+ item.SHOPNAME +"</td>";
							info += "<td>" + item.TOTALPRICE + "</td>";
							info += "<td>" + item.CT + "</td>";
							info += "<td><a href='javascript:_viewDetails(\"" + item.ID + "\");'>查看明细</a></td>";
							info += "</tr>";
						});
						 $("#orderList").append(info);    
					}
				});
			}
			getOrderList();
		});
		
		function _viewDetails(shopId) {
			window.location.href = "${base}shop_myOrderDetailList/" + shopId;
		}
	//-->
	</script>
<%@ include file="../../bottom.jsp" %>